package com.macro.mall.portal.controller;

import com.macro.mall.common.api.CommonResult;
import com.macro.mall.portal.service.SmsFlashPromotionProductRelationService;
import com.macro.mall.portal.vo.SmsFlashPromotionProductRelationVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(tags = "SmsFlashPromotionProductRelationController", description = "限时购和商品关系管理")
@RequestMapping("/flashProductRelation")
public class SmsFlashPromotionProductRelationController {
    @Autowired
    private SmsFlashPromotionProductRelationService relationService;
    @ApiOperation("查询不同场次关联商品信息")
    @RequestMapping(value = "/getPromotionProduct", method = RequestMethod.GET)
    public CommonResult<SmsFlashPromotionProductRelationVO> getPromotionProduct(@RequestParam(value = "id") Long id
                                                         ) {
        SmsFlashPromotionProductRelationVO flashPromotionProductList = relationService.getPromotionProduct(id);
        return CommonResult.success(flashPromotionProductList);
    }
}
